package com.ruoyi.gateway;

import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Mono;

/**
 * Description: new java files header..
 *
 * @author 兰剑
 * @version 1.0
 * @date 2023/3/3 8:47
 */
@Configuration
public class Raonfiguration {


    /**@Description: 按照path限流
     * @param 
     * @return key
     * @version v1.0
     * @author 兰剑
     * @date 2023/3/3 8:49
     */
    @Bean
    public KeyResolver pathKeyResolver(){
        return exchange -> Mono.just(
                exchange.getRequest()
                        .getPath()
                        .toString()
        );
    }

}
